package com.yanqu.road.entity.specialcookboy;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.DataStatus;
import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.utils.RandomHelper;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * 小当家特色服用户数据
 */
@FieldTypeAnnotation(tableName = "t_u_special_cook_boy_user_data", desc = "小当家特色服用户数据")
public class SpecialCookBoyUserData extends DataObject {

    @FieldTypeAnnotation(desc = "用户ID", select = true, update = true)
    private long userId;

    @FieldTypeAnnotation(desc = "引导状态")
    private int guideBit;

    @FieldTypeAnnotation(desc = "通关情况")
    private Map<Integer, Integer> passInfo;

    @FieldTypeAnnotation(desc = "分享密令")
    private String shareCode;

    @FieldTypeAnnotation(desc = "分享码刷新时间")
    private long shareCodeRefreshTime;

    @FieldTypeAnnotation(desc = "使用过的他人分享码")
    private List<String> usedOthersShareCode;

    @FieldTypeAnnotation(desc = "上次重置使用他人分享码时间")
    private long lastResetUsedOthersShareCodeTime;

    @FieldTypeAnnotation(desc = "本次自己分享码被他人使用的记录")
    private List<Long> shareCodeUsePlayers;

    @FieldTypeAnnotation(desc = "已解锁的提示")
    private List<Integer> unlockedTips;


    private int currentLevel;

    private boolean isShare;


    public long getUserId() {
        return userId;
    }
    public void setUserId(long userId) {
        if (this.userId != userId) {
            this.userId = userId;
            setOp(DataStatus.Update);
        }
    }

    public int getGuideBit() {
        return guideBit;
    }
    public void setGuideBit(int guideBit) {
        if (this.guideBit != guideBit) {
            this.guideBit = guideBit;
            setOp(DataStatus.Update);
        }
    }

    public java.util.Map<java.lang.Integer, java.lang.Integer> getPassInfo() {
        return passInfo;
    }
    public void setPassInfo(java.util.Map<java.lang.Integer, java.lang.Integer> passInfo) {
        if (null == passInfo){
            return;
        }
        if (this.passInfo == null || !this.passInfo.equals(passInfo)) {
            this.passInfo = passInfo;
            setOp(DataStatus.Update);
        }
    }

    public String getShareCode() {
        return shareCode;
    }
    public void setShareCode(String shareCode) {
        if (shareCode == null){
            return;
        }
        if (this.shareCode == null || !this.shareCode.equals(shareCode)) {
            this.shareCode = shareCode;
            setOp(DataStatus.Update);
        }
    }

    public long getShareCodeRefreshTime() {
        return shareCodeRefreshTime;
    }
    public void setShareCodeRefreshTime(long shareCodeRefreshTime) {
        if (this.shareCodeRefreshTime != shareCodeRefreshTime) {
            this.shareCodeRefreshTime = shareCodeRefreshTime;
            setOp(DataStatus.Update);
        }
    }

    public java.util.List<java.lang.String> getUsedOthersShareCode() {
        return usedOthersShareCode;
    }
    public void setUsedOthersShareCode(java.util.List<java.lang.String> usedOthersShareCode) {
        if (null == usedOthersShareCode){
            return;
        }
        if (this.usedOthersShareCode == null || !this.usedOthersShareCode.equals(usedOthersShareCode)) {
            this.usedOthersShareCode = usedOthersShareCode;
            setOp(DataStatus.Update);
        }
    }

    public long getLastResetUsedOthersShareCodeTime() {
        return lastResetUsedOthersShareCodeTime;
    }
    public void setLastResetUsedOthersShareCodeTime(long lastResetUsedOthersShareCodeTime) {
        if (this.lastResetUsedOthersShareCodeTime != lastResetUsedOthersShareCodeTime) {
            this.lastResetUsedOthersShareCodeTime = lastResetUsedOthersShareCodeTime;
            setOp(DataStatus.Update);
        }
    }

    public java.util.List<java.lang.Long> getShareCodeUsePlayers() {
        return shareCodeUsePlayers;
    }
    public void setShareCodeUsePlayers(java.util.List<java.lang.Long> shareCodeUsePlayers) {
        if (null == shareCodeUsePlayers){
            return;
        }
        if (this.shareCodeUsePlayers == null || !this.shareCodeUsePlayers.equals(shareCodeUsePlayers)) {
            this.shareCodeUsePlayers = shareCodeUsePlayers;
            setOp(DataStatus.Update);
        }
    }

    public List<Integer> getUnlockedTips() {
        return unlockedTips;
    }
    public void setUnlockedTips(List<Integer> unlockedTips) {
        if (null == unlockedTips){
            return;
        }
        if (this.unlockedTips == null || !this.unlockedTips.equals(unlockedTips)) {
            this.unlockedTips = unlockedTips;
            setOp(DataStatus.Update);
        }
    }

    public void addUnlockedTips(int tipId) {
        if (null == unlockedTips){
            unlockedTips = new ArrayList<>();
        }
        if (!this.unlockedTips.contains(tipId)) {
            this.unlockedTips.add(tipId);
            setOp(DataStatus.Update);
        }
    }



    public int getCurrentLevel() {
        return currentLevel;
    }
    public void setCurrentLevel(int currentLevel) {
        this.currentLevel = currentLevel;
    }

    public boolean getIsShare() {
        return isShare;
    }
    public void setIsShare(boolean isShare) {
        this.isShare = isShare;
    }



}
